/*
 *  CDCIDescriptor.h
 *  
 *
 *  Created by Peter on 23.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef CDCI_DESCRIPTOR_H
#define CDCI_DESCRIPTOR_H

#include "AObject.h"
#include "DIDDescriptor.h"

/* 
 * Color Difference Component Image Descriptor. Describes a YCbCr image.
 * Version is 2 for MC7 old versioning scheme, and still is for MC 5.0.3.
 */
class CDCIDescriptor : public DIDDescriptor
{
	
public:
	
	A_DECLARE_CLASS( 'CDCI', CDCIDescriptor, DIDDescriptor );
	
	// ----- member functions -----
	
	virtual void readFromStream( AStream& str, const AObjDoc& objd );
	virtual void dump( std::ostream& str ) const;
	
	
	// ----- data members -----
	
	UInt32 _horizontalSubsampling; // 2
	UInt32 _verticalSubsampling;   // 1
	
	// Number of bits per color component (8, 10 or 16)
	Int32  _componentWidth;
	
	Int16  _colorSiting;           // 0
	
	// Reference black value (usually 16, which is 0x10 hex). This is at offset 296
	// inside the chunk (but that's counting the base class stuff of course)
	UInt32 _blackReferenceLevel;
	
	// Reference white value (usually 235 or 0xEB hex). This follows directly after
	// the black level in the file.
	UInt32 _whiteReferenceLevel;
	
	UInt32 _colorRange; // 0x000000E1
	Int64  _offsetToFrameIndexes; // (OMFI 'JPED') 0x000600E7 0x00000000
	
};

#endif /*Inclusion Guard*/